% /*******************************************************************************
%  * Rounding Down
%  * *****************************************************************************
%  * Same as Round Nearest, except taking floor instead of near
%  * E.g. 10.11 -> 10 -> 10/2^2 -> 0.10
%  * @param x     Input number in [0,1)
%  * @param bits  Significant bits(or #bits to keep)
%  * @return      Rounded(down) number
%  */
function x_round = rnd_down(x,bits)
scale = 2^bits;
x_round = double(floor(x*scale)/scale);
end